use super::define_config_ast::DefineConfigAst;
use crate::util::create_ast;

#[test]
fn test_build_define_config_ast() {
    let ts_code = r#"export default defineConfig({ base: '/', server: {
        port: 3000,
        open: true,
        proxy: {
          "/api":{
            target: "http://100.110.123.200:8000"
          }
        } // 这是一个中文测试
    }
}
);
        "#;
    let module = create_ast(ts_code);
    let define_config_ast = DefineConfigAst::build(&module);

    println!(
        "arg_object_value:{:?}",
        define_config_ast.arg_object_value()
    );

    assert!(define_config_ast.arg_object_value().is_some());
}
